#!/usr/bin/python3
import warnings

import threading
from GlobVarLock import GlobVarLocker as glob

class IMUDataPloter(threading.Thread):
    def __init__(self):
        threading.Thread.__init__(self)

    def run(self):
        while (True):
            if(glob.getGyroDataRBLen()>0):
                pass
                # plot gyro data

            if(glob.getAccDataRBLen()>0):
                pass
                # plot acc data

            if(glob.getPoseDataRBLen()>0):
                pass
                # plot pose data


    def printGyroData(self):
        glob.lockGyroDataRB()
        glob.printGyroDataRB()
        glob.unlockGyroDataRB()

    def printQuatData(self):
        glob.lockQuatDataRB()
        glob.printQuatDataRB()
        glob.unlockQuatDataRB()

    def printAccData(self):
        glob.lockAccDataRB()
        glob.printAccDataRB()
        glob.unlockAccDataRB()

    def printPoseData(self):
        glob.lockPoseDataRB()
        glob.printPoseDataRB()
        glob.unlockPoseDataRB()

    def printMagnData(self):
        glob.lockMagnDataRB()
        glob.printMagnDataRB()
        glob.unlockMagnDataRB()

    def printEnvData(self):
        glob.lockEnvDataRB()
        glob.printEnvDataRB()
        glob.unlockEnvDataRB()
